feat(argocd): migrate ArgoCD plugin from Material UI v4 to v5#9708
feat(argocd): migrate ArgoCD plugin from Material UI v4 to v5#9708its-mitesh-kumar wants to merge 4 commits into
Conversation
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Changed Packages
|
There was a problem hiding this comment.
Pull request overview
Migrates the @backstage-community/plugin-argocd frontend plugin from Material UI v4 (@material-ui/*) to MUI v5 (@mui/material, @mui/icons-material) by updating component imports and replacing makeStyles/createStyles usage with styled()/sx.
Changes:
- Removed legacy
@material-ui/*dependencies and updated lockfile accordingly. - Replaced style hooks with
sx/styled()patterns across ArgoCD UI components. - Updated affected unit tests to align with the new component structure/styling approach.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| workspaces/argocd/yarn.lock | Removes legacy @material-ui/* entries. |
| workspaces/argocd/plugins/argocd/src/hooks/useIconStyles.ts | Replaces makeStyles icon styles with styled()/inline style exports. |
| workspaces/argocd/plugins/argocd/src/hooks/useDarkTheme.ts | Switches theme access to MUI v5 palette.mode. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentSummary/DeploymentSummary.tsx | Updates MUI imports to v5 component paths. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/RolloutStatusIcon.tsx | Replaces class-based icon styling/spin with wrapper + inline styles. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/RolloutStatus.tsx | Updates Chip import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/Rollouts.tsx | Replaces makeStyles with sx layout styles. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/Rollout.tsx | Replaces makeStyles container styles with sx. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/RevisionType.tsx | Updates Chip import/props for MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/RevisionStatus.tsx | Replaces class-based icon styling/spin with wrapper + inline styles. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/RevisionImage.tsx | Updates Typography import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/CanaryRevision.tsx | Replaces makeStyles with sx on Card. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/BlueGreenRevision.tsx | Updates MUI imports to v5 component paths. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/AnalysisRuns/AnalysisRunStatus.tsx | Replaces class-based icon styling/spin with wrapper + inline styles. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/revisions/AnalysisRuns/AnalysisRuns.tsx | Updates MUI imports and Chip usage for MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/rollouts/tests/RolloutStatusIcon.test.tsx | Updates test expectations for SpinWrapper structure. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/ResourcesTableRow.tsx | Replaces makeStyles with sx/inline styles for table rows. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/ResourcesTableHeader.tsx | Replaces makeStyles with sx on header cells. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/ResourcesTable.tsx | Replaces makeStyles with sx/inline styles and updates MUI imports. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/ResourcesSearchBar.tsx | Replaces makeStyles and v4 icons with MUI v5 sx + icons. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/ResourcesKebabMenuOptions.tsx | Updates Menu/IconButton imports and styling approach for MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/resource/DeploymentMetadata.tsx | Replaces makeStyles with a shared style object used via sx. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/resource/DeploymentHistoryCommit.tsx | Converts className usage to sx and updates imports. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/resource/DeploymentHistory.tsx | Converts container styling to sx and updates imports. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/tests/ResourcesTable.test.tsx | Updates pagination label assertion for MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleHeader.tsx | Updates IconButton import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleDrawer.tsx | Replaces Drawer classes styling with PaperProps.sx and updates imports. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleCard.tsx | Replaces makeStyles with sx on Card. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycle.tsx | Replaces makeStyles with a styled() container and updates theme mode usage. |
| workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/tests/DeploymentLifecycle.test.tsx | Updates ThemeProvider/createTheme usage for MUI v5 and palette.mode. |
| workspaces/argocd/plugins/argocd/src/components/Common/PermissionAlert.tsx | Replaces @material-ui/lab Alert imports with MUI v5 equivalents. |
| workspaces/argocd/plugins/argocd/src/components/Common/MetadataItemWithTooltip.tsx | Updates Typography/Tooltip imports to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/Common/MetadataItem.tsx | Updates Typography import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/Common/Metadata.tsx | Updates Typography import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/Common/AppServerLink.tsx | Updates Tooltip/Typography imports to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/Common/AppNamespace.tsx | Updates Chip/Typography imports and Chip variant for MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/Common/AppCommitLink.tsx | Replaces makeStyles and v4 Skeleton import with MUI v5 patterns. |
| workspaces/argocd/plugins/argocd/src/components/AppStatus/StatusIcons.tsx | Replaces class-based icon styling/spin with wrapper + inline styles. |
| workspaces/argocd/plugins/argocd/src/components/AppStatus/AppSyncStatus.tsx | Updates Chip import to MUI v5. |
| workspaces/argocd/plugins/argocd/src/components/AppStatus/AppHealthStatus.tsx | Updates Chip import to MUI v5. |
| workspaces/argocd/plugins/argocd/package.json | Removes legacy @material-ui/* dependencies and adds/keeps MUI v5 deps. |
| workspaces/argocd/plugins/argocd/dev/index.tsx | Updates Box import to MUI v5. |
| workspaces/argocd/.changeset/migrate-argocd-mui-v5.md | Adds a changeset documenting the MUI v4→v5 migration. |
Comments suppressed due to low confidence (1)
workspaces/argocd/plugins/argocd/src/components/DeploymentLifeCycle/sidebar/resources/resource/DeploymentHistoryCommit.tsx:69
aria-disabledis currently set totruewhencommitUrlexists (!!commitUrl), which is inverted. Also, whencommitUrlis null this rendershref="", creating a focusable link to the current page. Setaria-disabledwhen there is no URL and omithrefwhen absent.
<Link
aria-disabled={!!commitUrl}
href={commitUrl ?? ''}
target="_blank"
rel="noopener"
>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
/cc @Eswaraiahsapram |
Eswaraiahsapram
left a comment
There was a problem hiding this comment.
Thanks @its-mitesh-kumar , looks good to me. I just added few comments PTAL
|
|
||
| return revisions && latestRevision ? ( | ||
| <div className={classes.commitContainer}> | ||
| <div style={{ maxWidth: '280px' }}> |
There was a problem hiding this comment.
I think this loses the theme connection. It should use
| <div style={{ maxWidth: '280px' }}> | |
| <Box sx={{ maxWidth: theme => theme.spacing(35) }}> |
| mt: 1, | ||
| mb: 1, |
There was a problem hiding this comment.
Optional:
The object is typed as SxProps<Theme> and consumed via sx prop, so mt/mb work. But they only work in sx context.
| mt: 1, | |
| mb: 1, | |
| marginTop: '8px', | |
| marginBottom: '8px', |
| <div | ||
| style={{ | ||
| display: 'flex', | ||
| flexDirection: 'row', | ||
| justifyContent: 'space-between', | ||
| alignItems: 'baseline', | ||
| }} | ||
| > |
There was a problem hiding this comment.
| <div | |
| style={{ | |
| display: 'flex', | |
| flexDirection: 'row', | |
| justifyContent: 'space-between', | |
| alignItems: 'baseline', | |
| }} | |
| > | |
| <Box | |
| sx={{ | |
| display: 'flex', | |
| flexDirection: 'row', | |
| justifyContent: 'space-between', | |
| alignItems: 'baseline', | |
| }} | |
| > |
| <div | ||
| data-testid="no-resources" | ||
| style={{ | ||
| padding: '16px', | ||
| display: 'flex', | ||
| justifyContent: 'center', | ||
| }} | ||
| > |
There was a problem hiding this comment.
| <div | |
| data-testid="no-resources" | |
| style={{ | |
| padding: '16px', | |
| display: 'flex', | |
| justifyContent: 'center', | |
| }} | |
| > | |
| <Box | |
| data-testid="no-resources" | |
| sx={{ | |
| p: 2, | |
| display: 'flex', | |
| justifyContent: 'center', | |
| }} | |
| > |
| className={styles.canaryItem} | ||
| style={{ width: '500px' }} | ||
| sx={{ | ||
| width: '500px', |
There was a problem hiding this comment.
Since inline style always wins over CSS classes, the actual rendered width was always 500px. In that case why we have that dead code 🤔 (In the old code).
| sx={theme => ({ | ||
| border: `1px solid ${theme.palette.grey.A100}`, | ||
| ml: 1.875, | ||
| borderRadius: '4px', |
There was a problem hiding this comment.
| borderRadius: '4px', | |
| borderRadius: theme.spacing(0.5) |
debsmita1
left a comment
There was a problem hiding this comment.
tested the PR locally.
But the eslint rule to check for MUI4 imports is missing
Description
Migrate the ArgoCD plugin from Material UI v4 (
@material-ui/*) to Material UI v5 (@mui/material,@mui/icons-material). This replaces allmakeStyles/createStylespatterns with MUI v5styled()components andsxprop, updates all component imports to per-path MUI v5 imports, handles API breaking changes (e.g.palette.type→palette.mode, Chip/Drawer/Menu prop updates), and removes the legacy@material-ui/*dependencies frompackage.json.UI before Changes
S_.2026-06-28.at.7.mp4
UI after changes
S_.2026-06-28.at.3.58.57.PM.mov
S_.2026-06-28.at.4.01.43.PM.mov
✔️ Checklist